import request from '@/utils/request'

export const getArticles = params => request.get('/interview/query', { params })
// 文章详情
export const getDetail = (id) => request.get('/interview/show', { params: { id } })
// 点赞收藏
export const LikeArticle = (id) => request.post('/interview/opt', {
  id,
  optType: 1
})
export const CollectArticle = (id) => request.post('/interview/opt', {
  id,
  optType: 2
})

// 获取我的收藏
export const getArticlesCollect = (obj) => {
  return request.get('/interview/opt/list', {
    params: {
      page: obj.page, // 当前页
      pageSize: 5, // 可选
      optType: 2 // 表示收藏
    }
  })
}

// 获取我的喜欢
export const getArticlesLike = (obj) => {
  return request.get('/interview/opt/list', {
    params: {
      page: obj.page, // 当前页
      pageSize: 5, // 可选
      optType: 1 // 表示喜欢
    }
  })
}
